package com.example.webdriveddd.dto;

import lombok.Data;

import java.util.Objects;

@Data
public class FileTagDTO {
    private int id;
    private String tag;
    private int userId;

    public boolean equals(Object other){
        if (other instanceof FileTagDTO otherTag){
            if (this.id==otherTag.id){
                return true;
            }
            if (this.tag.equals(otherTag.tag)&&this.userId==otherTag.userId){
                return true;
            }
            return false;
        }
        return false;
    }

    @Override
    public int hashCode() {
        return Objects.hash(tag, userId);
    }
}
